package com.happyfamily.springboot.crowdsourcingplatform.controller.pan;

import com.happyfamily.springboot.crowdsourcingplatform.annotation.OperationLogDetail;
import com.happyfamily.springboot.crowdsourcingplatform.base.result.Results;
import com.happyfamily.springboot.crowdsourcingplatform.enums.OperationType;
import com.happyfamily.springboot.crowdsourcingplatform.enums.OperationUnit;
import com.happyfamily.springboot.crowdsourcingplatform.model.SysUser;
import com.happyfamily.springboot.crowdsourcingplatform.service.pan.UserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author Administrator
 * @create 2020/02/25 00:58
 */
@Controller
@RequestMapping("api-front/chat")
public class ChatController
{

	@Autowired
	private UserService userService;

	/**
	 * 跳转
	 * @param
	 * @return
	 */
	@RequestMapping ("/user-chat")
	public String UserPublishing(Model model){
		return "frontPage/user-chat";

	}

	/**
	 * 跳转
	 * @param
	 * @return
	 */
	@RequestMapping ("/service-list")
	@ApiOperation(value = "聊天室服务商类型获取", notes = "查询类型是服务商的数据", httpMethod = "GET", response = ModelAndView.class)
	@OperationLogDetail(detail = "聊天室服务商类型获取", level = 1, operationUnit = OperationUnit.USER, operationType = OperationType.SELECT)
	public ModelAndView UserServiceChat(ModelAndView modelAndView){
		//查询类型是服务商的数据
		List<SysUser> service=new ArrayList<>();
		service=userService.findByRid(2);
		modelAndView.addObject("service",service);

		modelAndView.setViewName("frontPage/service-list");
		return modelAndView;

	}





}
